package com.fili;

import java.awt.*;

/**
 * Created by Claudiu-Florin FILIMON
 * Date: Mar 2, 2007
 * Time: 12:53:39 PM
 * Revision: 0
 */
public class Ball
{
    public float pos;
    private BallPath ballPath;
    private Color color;


    public Ball(BallPath ballPath, float pos, Color color)
    {
        this.ballPath = ballPath;
        this.pos = pos;
        this.color = color;
    }

    public void paint(Graphics g)
    {
        Point p = ballPath.getPathPoint(pos);

        g.setColor(color);
        g.fillOval(p.x-DEF.BALL_RADIUS/2, p.y-DEF.BALL_RADIUS/2, DEF.BALL_RADIUS+1,DEF.BALL_RADIUS+1);
        g.setColor(Color.black);
        g.drawOval(p.x-DEF.BALL_RADIUS/2, p.y-DEF.BALL_RADIUS/2, DEF.BALL_RADIUS,DEF.BALL_RADIUS);
    }
}
